<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2019-2020 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class Plugins extends Validate
{
    protected $rule =   [
        'name'         => 'require',
        'value'        => 'require',
        'id'           => 'require',
        'install_type' => 'require',
    ];

    protected $message  =   [
        'name.require'         => ['status' => 'error', 'message' => '请指定插件名称'],
        'value.require'        => ['status' => 'error', 'message' => '请指定插件值'],
        'id.require'           => ['status' => 'error', 'message' => '请指定插件编号'],
        'install_type.require' => ['status' => 'error', 'message' => '请指定安装类型'],
    ];

    protected $scene = [
        'delete'  => ['name'],
        'update'  => ['name','value'],
        'install' => ['name','id','install_type'],
    ];
}